<?php

namespace App\Trip\Plane\Factories;

use App\Trip\Enums\Plane\PlaneProviders;
use App\Trip\Plane\Interfaces\Factories\PlaneOrderFactoryInterface;
use App\Trip\Plane\Interfaces\PlaneOrderInterface;
use App\Trip\Plane\Providers\BookOf51\Book51PlaneOrderAdapter;
use App\Trip\Plane\Providers\Qunar\QunarPlaneOrderAdapter;

/**
 * 供应商订单工厂
 */
class PlaneOrderFactory implements PlaneOrderFactoryInterface
{

    public function findOneByProvider(PlaneProviders $provider): PlaneOrderInterface
    {
        return $provider->getPlaneOrderStrategy();
    }

    public function Book51Order(): PlaneOrderInterface
    {
        return new Book51PlaneOrderAdapter();
    }

    public function QunarOrder(): PlaneOrderInterface
    {
        return new QunarPlaneOrderAdapter();
    }
}